package com.microstream.lift.guestbook;

import java.util.Date;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.users.User;
import com.microstream.dao.MsUser;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Greeting {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)    
    private Long id;

    @Persistent
    private User author;
    
    @Persistent
    private String userName;
    
    @Persistent 
    private String title; 
    
    @Persistent
    private String content;

    @Persistent
    private Date date;
    

    public Greeting(String userName, String title, String content, Date date) {
        this.userName = userName;
        
        if(title == null) title = ""; 
        this.title = title; 
        
        this.content = content;
        this.date = date;       
    }

	public Long getId() {
        return id;
    }

	public User getAuthor() {
        return author;
    }
	
    public String getUserName() {
		return userName;
	}

	public String getTitle() {
		if( title == null ) this.title = ""; 
		return title;
	}

    public String getContent() {
        return content;
    }
   
    public Date getDate() {
        return date;
    }

    public void setAuthor(User author) {
        this.author = author;
    }

	public void setUserName(String userName) {
		this.userName = userName;
	}

  
    public void setTitle(String title) {		
		this.title = title;
	}
    
    public void setContent(String content) {
        this.content = content;
    }

    public void setDate(Date date) {
        this.date = date;
    }
    
}
